package com.ruoyi.project.search.viewStock.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.search.viewStock.mapper.ViewStockMapper;
import com.ruoyi.project.search.viewStock.domain.ViewStock;
import com.ruoyi.project.search.viewStock.service.IViewStockService;
import com.ruoyi.common.core.text.Convert;

/**
 * 库存明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-30
 */
@Service
public class ViewStockServiceImpl implements IViewStockService 
{
    @Autowired
    private ViewStockMapper viewStockMapper;

    /**
     * 查询库存明细
     * 
     * @param stockId 库存明细主键
     * @return 库存明细
     */
    @Override
    public ViewStock selectViewStockByStockId(String stockId)
    {
        return viewStockMapper.selectViewStockByStockId(stockId);
    }

    /**
     * 查询库存明细列表
     * 
     * @param viewStock 库存明细
     * @return 库存明细
     */
    @Override
    public List<ViewStock> selectViewStockList(ViewStock viewStock)
    {
        return viewStockMapper.selectViewStockList(viewStock);
    }

    /**
     * 新增库存明细
     * 
     * @param viewStock 库存明细
     * @return 结果
     */
    @Override
    public int insertViewStock(ViewStock viewStock)
    {
        return viewStockMapper.insertViewStock(viewStock);
    }

    /**
     * 修改库存明细
     * 
     * @param viewStock 库存明细
     * @return 结果
     */
    @Override
    public int updateViewStock(ViewStock viewStock)
    {
        return viewStockMapper.updateViewStock(viewStock);
    }

    /**
     * 批量删除库存明细
     * 
     * @param stockIds 需要删除的库存明细主键
     * @return 结果
     */
    @Override
    public int deleteViewStockByStockIds(String stockIds)
    {
        return viewStockMapper.deleteViewStockByStockIds(Convert.toStrArray(stockIds));
    }

    /**
     * 删除库存明细信息
     * 
     * @param stockId 库存明细主键
     * @return 结果
     */
    @Override
    public int deleteViewStockByStockId(String stockId)
    {
        return viewStockMapper.deleteViewStockByStockId(stockId);
    }
}
